package com.dp.vo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Embeddable
public class THdTagsHdContentsPK implements Serializable {
	    @Basic(optional = false)
	    @JoinColumn(name = "tid", referencedColumnName = "tid")
	    @ManyToOne
	    private THdTags hdtag;
	    @Basic(optional = false)
	    @JoinColumn(name = "cid", referencedColumnName = "cid")
	    @ManyToOne
	    private NewsContenttitle content;

	    public THdTagsHdContentsPK(){
	    	
	    }
	    
	    public THdTagsHdContentsPK(Integer tid,Integer cid){
	    	this.hdtag=new THdTags(tid);
	    	this.content=new NewsContenttitle(cid);
	    }
	    
		public THdTags getHdtag() {
			return hdtag;
		}
		public void setHdtag(THdTags hdtag) {
			this.hdtag = hdtag;
		}
		public NewsContenttitle getContent(){
			return content;
		}
		public void setContent(NewsContenttitle content){
			this.content=content;
		}

		@Override
	    public int hashCode() {
	        int hash = 0;
	        hash += (hdtag != null ? hdtag.hashCode() : 0);
	        hash += (content != null ? content.hashCode() : 0);
	        return hash;
	    }

	    @Override
	    public boolean equals(Object object) {
	        if (!(object instanceof THdTagsHdContentsPK)) {
	            return false;
	        }
	        THdTagsHdContentsPK other = (THdTagsHdContentsPK) object;
	        if ((this.hdtag == null && other.hdtag != null) || (this.hdtag != null && !this.hdtag.equals(other.hdtag))) {
	            return false;
	        }
	        if ((this.content == null && other.content != null) || (this.content != null && !this.content.equals(other.content))) {
	            return false;
	        }
	        return true;
	    }

	    @Override
	    public String toString() {
	        return "com.dp.vo.THdTagsHdContentsPK[tid=" + hdtag.getTid() + ",cid="+content.getCid()+"]";
	    }
}
